package com.projectName.www.dao;

import java.sql.ResultSet;

public class Y_J_moneycount_dao {
    //初始化账户
    public  static int getmoney(String username) throws Exception {
        String sql="select * from  user where name = ? ";
        ResultSet resultSet = BaseDao.executeQuery(sql,username);
        resultSet.next();
        return  resultSet.getInt("money");

    }
    //充值按钮
    public static boolean upmoney(String name,int num) throws Exception {
        String sql="update user set money =? where name= ?";
        int i=BaseDao.executeUpdata(sql,num,name);
        if(i>0)return true;
        else return false;
    }

}
